#include"searcher.hpp"

static const string goal_path="./data/goal_html";//去标签后的路径

using std::cin;

int main()
{
    ns_searcher::Searcher* ser=new ns_searcher::Searcher();

    ser->InitSearcher(goal_path);

    char statement[1024];
    while(true)
    {
        cout<<"Please Enter the search statement:";
        //cin>>statement;
        fgets(statement,sizeof(statement)-1,stdin);

        statement[strlen(statement)-1]=0;//去掉'\n'

        string json_info;
        ser->Search(statement,json_info);
        cout<<json_info<<endl;
    }

    return 0;
}

// int main()
// {
//     httplib::Server svr;
//     svr.Get("/hi", [](const httplib::Request &req, httplib::Response &rsp)
//             { rsp.set_content("你好,世界!", "text/plain; charset=utf-8"); });
//     svr.listen("0.0.0.0", 8888);
//     return 0;
// }
